@extends('edit')
@section('content')
    <form class="layui-form" id="edit-form" action="{{url($baseRoute.'save')}}">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="c-red">*</span>商城名称</label>
            <div class="layui-input-inline">
                <input type="text" value="{{\App\Facade\Setting::appName()}}" name="app_name" placeholder="请输入商城名称"
                       autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">请输入商城名称</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="c-red">*</span>积分比例</label>
            <div class="layui-input-inline">
                <input type="text" value="{{\App\Facade\Setting::integralPercentage()}}" name="integral_percentage"
                       placeholder="请输入积分比例" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">积分比例,用于计算用户消费后能获取到的积分 单位%</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="c-red">*</span>评论审批</label>
            <div class="layui-input-inline">
                <input type="radio" name="audit_comment" value="true" title="是" @if(\App\Facade\Setting::auditComment()) checked @endif>
                <input type="radio" name="audit_comment" value="false" title="否" @if(!\App\Facade\Setting::auditComment()) checked @endif>
            </div>
            <div class="layui-form-mid layui-word-aux">评论审批,选择是，每条评论必须审核后才能显示；否，用户评论后直接显示</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="c-red">*</span>调整推送</label>
            <div class="layui-input-inline">
                <input type="radio" name="push_adjust_message" value="true" title="是" @if(\App\Facade\Setting::pushAdjustMessage()) checked @endif>
                <input type="radio" name="push_adjust_message" value="false" title="否" @if(!\App\Facade\Setting::pushAdjustMessage()) checked @endif>
            </div>
            <div class="layui-form-mid layui-word-aux">后台调整积分/余额推送消息,选择是，调整和给用户推送微信消息；否，则不推送</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">系统图片：</label>
            <div class="layui-input-inline">
                <input id="hiLogo" name="admin_image" value="{{\App\Facade\Setting::adminImage()}}" type="hidden"/>
                <input class="layui-btn layui-btn-sm" type="button" id="btnLogo" value="上传系统图片">
                <div class="layui-upload-list">
                    <img class="layui-upload-img" src="{{\App\Facade\File::image(\App\Facade\Setting::adminImage(),64,40)}}"
                         onerror="this.src='{{\App\Facade\File::defaultImage()}}'" width="64" id="imgLogo" />
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn">@lang('common.save')</button>
            </div>
        </div>
    </form>
@stop
@push('js')
<script>
    layui.use('form', function () {});
    SystemUtil.file.uploadImage('#btnLogo', 'card', function (imags) {
        var img = imags[0];
        $('#imgLogo').attr('src', img['url']);
        $('#hiLogo').val(img['id']);
    });
</script>
@endpush
